/**
 * @Author admin
 * @Date 2019/4/9 15:49
 */
import java.util.*;
class Test{
    public static void main(String args[])
    {
        Scanner cin=new Scanner(System.in);
        while(cin.hasNext())
        {
            int n=cin.nextInt();
            int m=cin.nextInt();
            if(n==0&&m==0)
                break;
            int []a=new int [n+1];
            int flag=0;
            for(int i=0;i<n+1;i++)
            {a[i]=cin.nextInt();
                if(a[i]>m&&(flag==0))
                {a[i+1]=a[i];
                    a[i]=m;
                    flag=1;
                    i++;}
            }
            for(int i=0;i<n;i++)
                System.out.print(a[i]+" ");
            System.out.println(a[n]);
        }
    }
}

